package agh.tk.markuptranslation;

public class Quote extends AbstractLeaf
{
	private int personNumber ; 

	public Quote(String text, int personNumber)
	{
		super(text) ;
		this.personNumber = personNumber ;
	}
	@Override
	public String toDokuWiki() 
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		for (int i = 0; i < personNumber; i++) 
		{
			stringBuilder.append('>') ;
		}
		stringBuilder.append(' ') ;
		stringBuilder.append(value) ;
		stringBuilder.append('\n') ;
		return stringBuilder.toString() ;
	}

	@Override
	public String toMediaWiki() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public String toHTML() {
		StringBuilder result = new StringBuilder("<cite>");
		for (int i = 0; i < personNumber; i++) 
		{
			result.append('>') ;
		}
		result.append(value);
		result.append("<cite>");
		return result.toString();
	}

	@Override
	public String toTxt2tags() 
	{
		StringBuilder stringBuilder = new StringBuilder() ;
		stringBuilder.append("\n") ;
		for(int i = 0 ; i < personNumber ; i++)
			stringBuilder.append("\t") ;
		stringBuilder.append(super.value) ;
		return stringBuilder.toString() ;
	}

	public int getPersonNumber()
	{
		return this.personNumber ;
	}
}
